package com.wbsxch.secondkill.mapper;

import com.wbsxch.secondkill.entity.SecondKill;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface SecondKillMapper {

    /**
     * 减库存
     */
    int reduceNumber(@Param("secondKillId") long secondKillId, @Param("killTime") Date killTime);

    /**
     * 根据id查询秒杀对象
     */
    SecondKill queryById(long secondKillId);

    /**
     * 根据偏移量查询秒杀商品列表
     */
    List<SecondKill> queryAll(@Param("offset") int offset, @Param("limit") int limit);
}
